import EventBus from "@/utils/event.js"; 
const $bus = new EventBus() 
export default {
	
	data(){
	  return {
		$bus,  
	  }	 
	},
	methods:{
		back(delta=1){
			uni.navigateBack({ delta:1,})
		},
		toPage(url){
			uni.navigateTo({ url })
		},
		tip(title){
			uni.showToast({title,icon:'none',duration: 2000});
		},
		getBus(){
			return $bus
		},
		changeLang(lang) {
		  console.log('语言切换') 
		  uni.setStorageSync('CURRENT_LANG', lang)
		},
		
		isPwd(pwd){
			return /^(?=.*)[a-zA-Z0-9]{8,20}$/.test(pwd)
		},
	},
	
}